#ifndef LINFOPROCESSOR_H_
#define LINFOPROCESSOR_H_

#include <MTXml/MTXml.h>
#include <MAUtil/String.h>
#include "DTO.h"

using namespace MAUtil;
using namespace Mtx;

class LINFOProcessor : public XmlListener
{
  public:
    LINFOProcessor();
    ~LINFOProcessor();

    //XmlListener
    void mtxEncoding(const char* value);
    void mtxTagStart(const char* name, int len);
    void mtxTagAttr(const char* attrName, const char* attrValue);
    void mtxTagStartEnd();
    void mtxTagData(const char* data, int len);
    void mtxTagEnd(const char* name, int len);
    void mtxParseError();
    void mtxEmptyTagEnd();
    unsigned char mtxUnicodeCharacter(int unicode);

    //Property setters
    void setLINFOListener(LINFOListener* listener);
    void addRequest(String& url, String& id, LINFOListener* requester);
  private:
    enum LINFO_Tags
    {
    	LINFO_NULL,
    	LINFO_RESULT,
    	LINFO_OUTOFDATE,
    	LINFO_ISNEW,
    	LINFO_ISEND,
    	LINFO_REMAINTIME

    } mLINFOTag;

    LINFOListener* mListener;
    LINFOItem mCurrentItem;
    String temp;
    String mFirstTag;
    bool mInBody;
    bool mInItem;
};

#endif /* LINFOPROCESSOR_H_ */
